<template>
    <div class="mainstyle">
        <h1>{{ item.title }}</h1>
        <p>
            <span>发表时间:{{ item.add_time | dataformate}}</span>
            <span>点击{{ item.click }}次</span>
        </p>
        <hr>
        <div class="content" v-html="item.content"></div>
        <diss-box :id="id"></diss-box>
    </div>
</template>

<script>
import diss from './../comm/diss.vue'
    export default{
 
        data()
        {
            return{
                id:this.$route.params.id ,
                item:{},
            }
        },
        created(){
            this.getNew();
            },
        methods:{
            getNew(){
                this.$http.get("api/getnew/"+this.id).then(result=>{
                    if(result.body.status===0)
                    {
                       this.item=result.body.message[0]
                    }
                })
            }
        },
               components:{
           'diss-box':diss
        }

    }
</script>

<style lang="scss" scoped>
.mainstyle{
    padding: 0 4px;
    text-align: center;
    margin: 10px 0;
    h1{
        font-size: 16px;
        color:red;
    };
    p{
          font-size: 14px;
          color: blue;
          display: flex;
          justify-content: space-between;
         
    }
}
</style>
